package com.cqjtu.tto.controller;

import com.cqjtu.tto.service.EmployeePerformanceService;
import com.cqjtu.tto.service.SysUserService;
import com.cqjtu.tto.vo.Results;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Api(tags = {"员工绩效接口"})
@RequestMapping("/employeePerformance")
public class EmployeePerformanceController {
    @Autowired
    private EmployeePerformanceService employeePerformanceService;

    @ApiOperation(value = "获取员工上个月的绩效情况", notes = "获取员工上个月的绩效情况，仅管理员有这个权限，返回值EmployeePerformanceVo")
    @GetMapping("/listEmployeePerformanceLastMonth")
    public Results listEmployeePerformanceLastMonth(){
        return employeePerformanceService.listEmployeePerformanceLastMonth();
    }

    @ApiOperation(value = "获取某个员工的历史绩效", notes = "获取某个员工的历史绩效，参数为员工id，返回值EmployeePerformanceVo")
    @GetMapping("/listEmployeePerformanceHistoryByUserId")
    public Results listEmployeePerformanceHistoryByUserId(@RequestParam("id")Long sysUserId){
        return employeePerformanceService.listEmployeePerformanceHistoryByUserId(sysUserId);
    }

}
